Motion.SimulateAxisAbsolute method
Calculates the duration an absolute move takes to complete.
Namespace: IntervalZero.KINGSTAR.Local.Api
Assembly: IntervalZero.KINGSTAR.Local.Api (in IntervalZero.KINGSTAR.Local.dll) Version: 4.4.0.0
Syntax
public KsReturn<McMoveDuration> SimulateAxisAbsolute(
int Index,
double Position,
double Velocity,
double Acceleration,
double Deceleration,
double Jerk,
McDirection Direction
)
Public Function SimulateAxisAbsolute(
Index As Integer,
Position As Double,
Velocity As Double,
Acceleration As Double,
Deceleration As Double,
Jerk As Double,
Direction As McDirection
) As KsReturn(Of McMoveDuration)
Parameters
Index
Type: int
The index of an axis. Indexes are zero based. Aliases affect this parameter.
Position
Type: double
The target position for the motion. [unit] (negative or positive)
Velocity
Type: double
A value of the maximum velocity. Not necessarily reached if the target position is close. [unit/second]
Acceleration
Type: double
A value of the acceleration. Always positive. The unit is determined by McProfileType. (increasing power of the motor) [unit/second2] or [second]
Deceleration
Type: double
A value of the deceleration. Always positive. The unit is determined by McProfileType. (decreasing power of the motor) [unit/second2] or [second]
Jerk
Type: double
A value of the jerk. Always positive. The unit is determined by McProfileType. [unit/second3] or [second]
Direction
Type: McDirection
The moving direction of an axis.
Return value
Type: KsReturn<McMoveDuration>
Returns a KsError code and an McMoveDuration value.
Remarks
When modulo axis is enabled, the modulo value will be applied to the Position parameter, and the axis movement is simulated according to the configured Direction.
For example, with a modulo value of 360, when Direction is set to:
- mcShortestWay / mcCurrentDirection: The axis simulates movement along the shortest distance to reach the target. If there is a tie, the axis will simulate movement in the positive direction. For example, if the current position is 0 and the target position is 340, the axis will simulate moving -20 to reach the target position.
- mcPositiveDirection: The axis simulates movement in the positive direction to reach the target. For example, if the current position is 0 and the target position is -20, the axis will simulate moving 340 to reach the target position.
- mcNegativeDirection: The axis simulates movement in the negative direction to reach the target. For example, if the current position is 0 and the target position is 20, the axis will simulate moving -340 to reach the target position.
Examples
N/A
See also